package com.css.zfzx.sjcj.modules.hddccjfilemanage.repository;

import com.css.zfzx.sjcj.modules.hddccjfilemanage.repository.entity.HddcFileManageEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author zyb
 * @date 2020-12-10
 */
public interface HddcFileManageRepository extends JpaRepository<HddcFileManageEntity, String> {
    @Query(nativeQuery = true,value="select f.* from hddc_file_manage f where f.is_valid !=0 and f.file_id =:filenumber")
    List<HddcFileManageEntity> findbyId(@Param("filenumber") String filenumber);

    @Query(nativeQuery = true, value = "select * from hddc_file_manage where is_valid !=0 and project_name in :projectIds")
    List<HddcFileManageEntity> queryHddcFileManagesByProjectId(List<String> projectIds);

    @Query(nativeQuery = true, value = "select * from hddc_file_manage where is_valid !=0 and task_name in :taskIds")
    List<HddcFileManageEntity> queryHddcFileManagesByTaskId(List<String> taskIds);
}
